interface ICONDITION {
    [index:string]:string
}

export default class Delete {
    private readonly _knex;
    constructor(props){
        const {knex} = props;
        this._knex = knex;
    }

    delete(TABLE_NAME:string, CONDITION:ICONDITION){

        return this._knex(TABLE_NAME).delete(CONDITION).del().then(()=>{
            return 'ok'
        }).catch((err)=>{
            console.error('Delete');
            throw err;
        });
    }

}